package edu.hawaii.its381b.shared;

import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.Persistent;
//import javax.jdo.annotations.NotPersistent;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Extension;

import java.io.Serializable;
import java.util.Date;

@SuppressWarnings("unused")
@PersistenceCapable(identityType = IdentityType.APPLICATION) 
public class Score implements Serializable {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	private String id;
	//private Key key;

	@Persistent
	private String name;

	@Persistent
	private Long time;

	@Persistent
	private Integer score;

	@Persistent
	private Date createdTimestamp;
	
	public Score() {
		super();
		this.name = new String("WAQ Player");
		this.createdTimestamp = new Date();
		this.time = new Long(0);
		this.score = new Integer(0);
	}
	
	public Score(String name) {
		this();
		this.name = name;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public long getTime() {
		return time.longValue();
	}

	public void setTime(long time) {
		this.time = new Long(time);
	}

	public int getScore() {
		return score.intValue();
	}

	public void setScore(int score) {
		this.score = new Integer(score);
	}
}
